﻿$(document).ready(main);
function main (){

    $(".select-button").bind("click", function () {       
        var idEnterprise = $(this).parent().parent().children(".enterprise-id").text();
        $("#lblMessage").html("");
        $.ajax({
            url: "\SearchForAnalysis",
            type: "post",
            data: { idEnterprise: idEnterprise },
            dataType: "json",
            success: function (data) {
                $("#lblMessage").text(data.result);
                if (data.value == 1) {
                    $("#creditgranting_button").show();
                } else {
                    $("#creditgranting_button").hide();
                }
            }
           
        });
    });
}
